<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2015/3/12
  Time: 10:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <link rel="stylesheet" href="<%=request.getContextPath()%>/resources/css/admin/basic.css" type="text/css"/>
    <link rel="stylesheet" href="<%=request.getContextPath()%>/resources/css/admin/index.css" type="text/css"/>
    <link rel="stylesheet" href="<%=request.getContextPath()%>/resources/css/admin/table1.css" type="text/css"/>
    <link rel="stylesheet" href="<%=request.getContextPath()%>/resources/css/icon.css" type="text/css"/>
    <script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/jquery-1.8.3.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/main.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/admin/jquery.adminnew.js"></script>

    <script type="text/javascript">
    $(function(){
        $("#admintable").admintable();
    });
</script>
</head>
<body>
<div class="main_content_container">
    <sf:form method="post" modelAttribute="order" enctype="multipart/form-data">
        <table id="admintable" cellpadding="0" cellspacing="0">
            <thead>
            <tr showCheck="1">
                <td width="5%" align="center"><strong>订单编号</strong></td>
                <td width="6%" align="center"><strong>商家ID</strong></td>
                <td width="6%" align="center"><strong>买家ID</strong></td>
                <td width="39%" align="center"><strong>订单地址</strong></td>
                <td width="8%" align="center"><strong>订单价格</strong></td>
                <td width="15%" align="center"><strong>下单时间</strong></td>
                <td width="10%" align="center"><strong>订单状态</strong></td>
                <td width="8%" align="center"><strong>用户操作</strong></td>
            </tr>
            </thead>

            <tbody>
                <tr>
                    <td align="center">${order.id}</td>
                    <td align="center">${order.seller_id}</td>
                    <td align="center">${order.user_id}</td>
                    <td align="center">
                            ${order.address.address}
                    </td>
                    <c:if test="${order.state=='待付款'}">
                        <td objId="${order.total}" align="center"> <sf:input path="total"/></td>
                    </c:if>
                    <c:if test="${order.state!='待付款'}">
                        <td objId="${order.total}" align="center"> ${order.total}</td>
                    </c:if>

                    <td objId="${order.orderdate}" align="center">${order.orderdate}</td>
                    <c:choose>
                        <c:when test="${order.state=='待发货'}">
                            <td objId="${order.state}" align="center">
                                <sf:select path="state">
                                    <sf:option value="待发货"/>
                                    <sf:option value="待收货"/>
                                </sf:select>
                            </td>
                        </c:when>
                        <c:when test="${order.state=='退款中...'}">
                            <td objId="${order.state}" align="center">
                                <sf:select path="state">
                                    <sf:option value="退款成功"/>
                                </sf:select>
                            </td>
                        </c:when>
                        <c:otherwise>
                            <td objId="${order.state}" align="center">
                                    ${order.state}
                            </td>
                        </c:otherwise>
                    </c:choose>
                    <td align="center">
                        <c:choose>
                            <c:when test="${order.state eq '退款中...' }">
                                <input type="submit" value="保存"> &nbsp;
                            </c:when>
                            <c:when test="${order.state eq '待付款' }">
                                <input type="submit" value="保存"> &nbsp;
                            </c:when>
                            <c:when test="${order.state eq '待发货'}">
                                <input type="submit" value="保存"> &nbsp;
                            </c:when>
                            <c:otherwise>
                                完成 &nbsp;
                            </c:otherwise>
                        </c:choose>
                    </td>
                </tr>
            </tbody>
        </table>
    </sf:form>
</div>
</div>
</body>
</html>